

import 'package:flutter/material.dart';
import 'package:get/get.dart';

class CheckableCard extends StatelessWidget {

  final bool isChecked;
  final String title;
  final GestureTapCallback onPress;

  CheckableCard({Key key, @required this.isChecked, @required this.title, this.onPress}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Container(
        height: 100,
        padding: EdgeInsets.only(left: 40, top: 14),
        decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(14) ,
            color: isChecked ? Color(0xFF3711FE) : Color(0xFFD3D3D3)
        ),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            Text(title, style: TextStyle(color: Colors.white, fontSize: 20),),
            Text(isChecked ? "是" : "否", style: TextStyle(color: Colors.white, fontSize: 20),),
          ],
        ),
      ),
      onTap: onPress,
    );
  }

}